import * as THREE from 'three';

// import { GLTFLoader } from 'three/examples/jsm/loaders/GLTFLoader.js';
// const loader = new GLTFLoader();
const model  =  new THREE.Group();


model.position.set(-(944/2),-(265/2),0);  //改变组对象顶点坐标

const geometry = new THREE.PlaneGeometry(944, 265);
  geometry.translate(944/2,265/2,0); 
//纹理贴图加载器TextureLoader
const texLoader = new THREE.TextureLoader();
// .load()方法加载图像，返回一个纹理对象Texture
// const texture = texLoader.load('./指南针.png');

export const texture10 = texLoader.load(require("@/views/witness/components/Object3D/canvas/10.png"));
export const texture12 = texLoader.load(require("@/views/witness/components/Object3D/canvas/12.png"));
const material = new THREE.MeshLambertMaterial({
    map: texture10,//map表示材质的颜色贴图属性
    transparent:true,//开启透明，这样png贴图的透明部分不显示
    // side:THREE.DoubleSide,
});
 //场地  
const GeoB15 = new THREE.PlaneGeometry(92, 85); 
      GeoB15.translate(92/2, 85/2,0); // 平移
const matEveryone = new THREE.MeshLambertMaterial({
    color: '#fff',//map表示材质的颜色贴图属性
});
const meshB15 = new THREE.Mesh(GeoB15,matEveryone.clone())
meshB15.name = '评标室15'

// wanger 警告标识 
const GeoWanger = new THREE.PlaneGeometry (12, 12);
const matWanger = new THREE.MeshLambertMaterial({
    map:texLoader.load(require("@/assets/imgs/dp/警告@2x.png")), 
    transparent:true,
  
    // alphaMap:new THREE.Color('#fff')
})
export const meshWanger = new THREE.Mesh(GeoWanger, matWanger);

// 预警广播
const GeoWangerT =  new THREE.PlaneGeometry (254, 122);
const matWangerT = new THREE.MeshLambertMaterial({
    map:texLoader.load(require("@/assets/imgs/dp/预警背景.png")), 
    transparent:true,
    opacity:0.7//设置透明度
})
export const meshWangerT   = new THREE.Mesh(GeoWangerT, matWangerT);
meshWangerT.name = '预警背景'
meshWangerT.position.set(700, 350,0)
// 楼层
export const mesh =  new THREE.Mesh(geometry, material);
mesh.name = '场地'
// const axesHelper = new THREE.AxesHelper(100);
// // mesh.add(meshB15);
// // mesh.add(meshWangerT)
// mesh.add(axesHelper);
// mesh.position.set(780,240, 1);
model.add(mesh)
// mesh.rotateX(-Math.PI/2);
// mesh.position.y = 2;
export default model

